3.1.47 \(\int \frac {A+B x+C x^2}{(d+e x) (a+c x^2)} \, dx\) [47]

3.1.47.1 Optimal result
3.1.47.2 Mathematica [A] (verified)
3.1.47.3 Rubi [A] (verified)
3.1.47.4 Maple [A] (verified)
3.1.47.5 Fricas [A] (verification not implemented)
3.1.47.6 Sympy [F(-1)]
3.1.47.7 Maxima [A] (verification not implemented)
3.1.47.8 Giac [A] (verification not implemented)
3.1.47.9 Mupad [B] (verification not implemented)

3.1.47.1 Optimal result

Integrand size = 27, antiderivative size = 133 \[ \int \frac {A+B x+C x^2}{(d+e x) \left (a+c x^2\right )} \, dx=\frac {(A c d-a C d+a B e) \arctan \left (\frac {\sqrt {c} x}{\sqrt {a}}\right )}{\sqrt {a} \sqrt {c} \left (c d^2+a e^2\right )}+\frac {\left (C d^2-B d e+A e^2\right ) \log (d+e x)}{e \left (c d^2+a e^2\right )}+\frac {(B c d-A c e+a C e) \log \left (a+c x^2\right )}{2 c \left (c d^2+a e^2\right )} \]

output
(A*e^2-B*d*e+C*d^2)*ln(e*x+d)/e/(a*e^2+c*d^2)+1/2*(-A*c*e+B*c*d+C*a*e)*ln( 
c*x^2+a)/c/(a*e^2+c*d^2)+(A*c*d+B*a*e-C*a*d)*arctan(x*c^(1/2)/a^(1/2))/(a* 
e^2+c*d^2)/a^(1/2)/c^(1/2)
 
3.1.47.2 Mathematica [A] (verified)

Time = 0.06 (sec) , antiderivative size = 120, normalized size of antiderivative = 0.90 \[ \int \frac {A+B x+C x^2}{(d+e x) \left (a+c x^2\right )} \, dx=\frac {2 \sqrt {c} e (A c d-a C d+a B e) \arctan \left (\frac {\sqrt {c} x}{\sqrt {a}}\right )+\sqrt {a} \left (2 c \left (C d^2-B d e+A e^2\right ) \log (d+e x)+e (B c d-A c e+a C e) \log \left (a+c x^2\right )\right )}{2 \sqrt {a} c e \left (c d^2+a e^2\right )} \]

input
Integrate[(A + B*x + C*x^2)/((d + e*x)*(a + c*x^2)),x]
 
output
(2*Sqrt[c]*e*(A*c*d - a*C*d + a*B*e)*ArcTan[(Sqrt[c]*x)/Sqrt[a]] + Sqrt[a] 
*(2*c*(C*d^2 - B*d*e + A*e^2)*Log[d + e*x] + e*(B*c*d - A*c*e + a*C*e)*Log 
[a + c*x^2]))/(2*Sqrt[a]*c*e*(c*d^2 + a*e^2))
 
3.1.47.3 Rubi [A] (verified)

Time = 0.34 (sec) , antiderivative size = 133, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.074, Rules used = {2160, 2009}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int \frac {A+B x+C x^2}{\left (a+c x^2\right ) (d+e x)} \, dx\)

\(\Big \downarrow \) 2160

\(\displaystyle \int \left (\frac {x (a C e-A c e+B c d)+a B e-a C d+A c d}{\left (a+c x^2\right ) \left (a e^2+c d^2\right )}+\frac {A e^2-B d e+C d^2}{(d+e x) \left (a e^2+c d^2\right )}\right )dx\)

\(\Big \downarrow \) 2009

\(\displaystyle \frac {\arctan \left (\frac {\sqrt {c} x}{\sqrt {a}}\right ) (a B e-a C d+A c d)}{\sqrt {a} \sqrt {c} \left (a e^2+c d^2\right )}+\frac {\log \left (a+c x^2\right ) (a C e-A c e+B c d)}{2 c \left (a e^2+c d^2\right )}+\frac {\log (d+e x) \left (A e^2-B d e+C d^2\right )}{e \left (a e^2+c d^2\right )}\)

input
Int[(A + B*x + C*x^2)/((d + e*x)*(a + c*x^2)),x]
 
output
((A*c*d - a*C*d + a*B*e)*ArcTan[(Sqrt[c]*x)/Sqrt[a]])/(Sqrt[a]*Sqrt[c]*(c* 
d^2 + a*e^2)) + ((C*d^2 - B*d*e + A*e^2)*Log[d + e*x])/(e*(c*d^2 + a*e^2)) 
 + ((B*c*d - A*c*e + a*C*e)*Log[a + c*x^2])/(2*c*(c*d^2 + a*e^2))
 

3.1.47.3.1 Defintions of rubi rules used

rule 2009
Int[u_, x_Symbol] :> Simp[IntSum[u, x], x] /; SumQ[u]
 

rule 2160
Int[(Pq_)*((d_) + (e_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^2)^(p_.), x_Symbol] 
:> Int[ExpandIntegrand[(d + e*x)^m*Pq*(a + b*x^2)^p, x], x] /; FreeQ[{a, b, 
 d, e, m}, x] && PolyQ[Pq, x] && IGtQ[p, -2]
 
3.1.47.4 Maple [A] (verified)

Time = 0.56 (sec) , antiderivative size = 112, normalized size of antiderivative = 0.84

method result size
default \(\frac {\frac {\left (-A c e +B c d +C a e \right ) \ln \left (c \,x^{2}+a \right )}{2 c}+\frac {\left (A c d +B a e -C a d \right ) \arctan \left (\frac {c x}{\sqrt {a c}}\right )}{\sqrt {a c}}}{e^{2} a +c \,d^{2}}+\frac {\left (A \,e^{2}-B d e +C \,d^{2}\right ) \ln \left (e x +d \right )}{e \left (e^{2} a +c \,d^{2}\right )}\) \(112\)
risch \(\frac {\ln \left (e x +d \right ) e A}{e^{2} a +c \,d^{2}}-\frac {\ln \left (e x +d \right ) B d}{e^{2} a +c \,d^{2}}+\frac {\ln \left (e x +d \right ) C \,d^{2}}{e \left (e^{2} a +c \,d^{2}\right )}+\frac {\left (\munderset {\textit {\_R} =\operatorname {RootOf}\left (\left (a^{2} c^{2} e^{2}+a \,c^{3} d^{2}\right ) \textit {\_Z}^{2}+\left (2 A a \,c^{2} e -2 B a \,c^{2} d -2 a^{2} c e C \right ) \textit {\_Z} +A^{2} c^{2}-2 A C a c +B^{2} a c +C^{2} a^{2}\right )}{\sum }\textit {\_R} \ln \left (\left (\left (3 a \,c^{2} e^{3}-c^{3} d^{2} e \right ) \textit {\_R}^{2}+\left (3 A \,c^{2} e^{2}-B \,c^{2} d e -5 C a c \,e^{2}+2 C \,c^{2} d^{2}\right ) \textit {\_R} -2 A C c e +2 B^{2} c e -2 B C c d +2 C^{2} a e \right ) x +4 a \,c^{2} d \,e^{2} \textit {\_R}^{2}+\left (A \,c^{2} d e -B \,e^{2} a c -5 a c d e C \right ) \textit {\_R} +2 A B c e -2 A C c d +2 C^{2} a d \right )\right )}{2}\) \(307\)

input
int((C*x^2+B*x+A)/(e*x+d)/(c*x^2+a),x,method=_RETURNVERBOSE)
 
output
1/(a*e^2+c*d^2)*(1/2*(-A*c*e+B*c*d+C*a*e)/c*ln(c*x^2+a)+(A*c*d+B*a*e-C*a*d 
)/(a*c)^(1/2)*arctan(c*x/(a*c)^(1/2)))+(A*e^2-B*d*e+C*d^2)*ln(e*x+d)/e/(a* 
e^2+c*d^2)
 
3.1.47.5 Fricas [A] (verification not implemented)

Time = 4.61 (sec) , antiderivative size = 262, normalized size of antiderivative = 1.97 \[ \int \frac {A+B x+C x^2}{(d+e x) \left (a+c x^2\right )} \, dx=\left [-\frac {{\left (B a e^{2} - {\left (C a - A c\right )} d e\right )} \sqrt {-a c} \log \left (\frac {c x^{2} - 2 \, \sqrt {-a c} x - a}{c x^{2} + a}\right ) - {\left (B a c d e + {\left (C a^{2} - A a c\right )} e^{2}\right )} \log \left (c x^{2} + a\right ) - 2 \, {\left (C a c d^{2} - B a c d e + A a c e^{2}\right )} \log \left (e x + d\right )}{2 \, {\left (a c^{2} d^{2} e + a^{2} c e^{3}\right )}}, \frac {2 \, {\left (B a e^{2} - {\left (C a - A c\right )} d e\right )} \sqrt {a c} \arctan \left (\frac {\sqrt {a c} x}{a}\right ) + {\left (B a c d e + {\left (C a^{2} - A a c\right )} e^{2}\right )} \log \left (c x^{2} + a\right ) + 2 \, {\left (C a c d^{2} - B a c d e + A a c e^{2}\right )} \log \left (e x + d\right )}{2 \, {\left (a c^{2} d^{2} e + a^{2} c e^{3}\right )}}\right ] \]

input
integrate((C*x^2+B*x+A)/(e*x+d)/(c*x^2+a),x, algorithm="fricas")
 
output
[-1/2*((B*a*e^2 - (C*a - A*c)*d*e)*sqrt(-a*c)*log((c*x^2 - 2*sqrt(-a*c)*x 
- a)/(c*x^2 + a)) - (B*a*c*d*e + (C*a^2 - A*a*c)*e^2)*log(c*x^2 + a) - 2*( 
C*a*c*d^2 - B*a*c*d*e + A*a*c*e^2)*log(e*x + d))/(a*c^2*d^2*e + a^2*c*e^3) 
, 1/2*(2*(B*a*e^2 - (C*a - A*c)*d*e)*sqrt(a*c)*arctan(sqrt(a*c)*x/a) + (B* 
a*c*d*e + (C*a^2 - A*a*c)*e^2)*log(c*x^2 + a) + 2*(C*a*c*d^2 - B*a*c*d*e + 
 A*a*c*e^2)*log(e*x + d))/(a*c^2*d^2*e + a^2*c*e^3)]
 
3.1.47.6 Sympy [F(-1)]

Timed out. \[ \int \frac {A+B x+C x^2}{(d+e x) \left (a+c x^2\right )} \, dx=\text {Timed out} \]

input
integrate((C*x**2+B*x+A)/(e*x+d)/(c*x**2+a),x)
 
output
Timed out
 
3.1.47.7 Maxima [A] (verification not implemented)

Time = 0.27 (sec) , antiderivative size = 123, normalized size of antiderivative = 0.92 \[ \int \frac {A+B x+C x^2}{(d+e x) \left (a+c x^2\right )} \, dx=\frac {{\left (B c d + {\left (C a - A c\right )} e\right )} \log \left (c x^{2} + a\right )}{2 \, {\left (c^{2} d^{2} + a c e^{2}\right )}} + \frac {{\left (C d^{2} - B d e + A e^{2}\right )} \log \left (e x + d\right )}{c d^{2} e + a e^{3}} + \frac {{\left (B a e - {\left (C a - A c\right )} d\right )} \arctan \left (\frac {c x}{\sqrt {a c}}\right )}{{\left (c d^{2} + a e^{2}\right )} \sqrt {a c}} \]

input
integrate((C*x^2+B*x+A)/(e*x+d)/(c*x^2+a),x, algorithm="maxima")
 
output
1/2*(B*c*d + (C*a - A*c)*e)*log(c*x^2 + a)/(c^2*d^2 + a*c*e^2) + (C*d^2 - 
B*d*e + A*e^2)*log(e*x + d)/(c*d^2*e + a*e^3) + (B*a*e - (C*a - A*c)*d)*ar 
ctan(c*x/sqrt(a*c))/((c*d^2 + a*e^2)*sqrt(a*c))
 
3.1.47.8 Giac [A] (verification not implemented)

Time = 0.34 (sec) , antiderivative size = 123, normalized size of antiderivative = 0.92 \[ \int \frac {A+B x+C x^2}{(d+e x) \left (a+c x^2\right )} \, dx=\frac {{\left (B c d + C a e - A c e\right )} \log \left (c x^{2} + a\right )}{2 \, {\left (c^{2} d^{2} + a c e^{2}\right )}} + \frac {{\left (C d^{2} - B d e + A e^{2}\right )} \log \left ({\left | e x + d \right |}\right )}{c d^{2} e + a e^{3}} - \frac {{\left (C a d - A c d - B a e\right )} \arctan \left (\frac {c x}{\sqrt {a c}}\right )}{{\left (c d^{2} + a e^{2}\right )} \sqrt {a c}} \]

input
integrate((C*x^2+B*x+A)/(e*x+d)/(c*x^2+a),x, algorithm="giac")
 
output
1/2*(B*c*d + C*a*e - A*c*e)*log(c*x^2 + a)/(c^2*d^2 + a*c*e^2) + (C*d^2 - 
B*d*e + A*e^2)*log(abs(e*x + d))/(c*d^2*e + a*e^3) - (C*a*d - A*c*d - B*a* 
e)*arctan(c*x/sqrt(a*c))/((c*d^2 + a*e^2)*sqrt(a*c))
 
3.1.47.9 Mupad [B] (verification not implemented)

Time = 15.63 (sec) , antiderivative size = 840, normalized size of antiderivative = 6.32 \[ \int \frac {A+B x+C x^2}{(d+e x) \left (a+c x^2\right )} \, dx=\frac {\ln \left (d+e\,x\right )\,\left (C\,d^2-B\,d\,e+A\,e^2\right )}{c\,d^2\,e+a\,e^3}-\frac {\ln \left (x\,\left (c\,e\,B^2-c\,d\,B\,C+a\,e\,C^2-A\,c\,e\,C\right )+C^2\,a\,d+\frac {\left (c^2\,\left (\frac {A\,a\,e}{2}-\frac {B\,a\,d}{2}\right )-c\,\left (\frac {C\,a^2\,e}{2}-\frac {A\,d\,\sqrt {-a\,c^3}}{2}\right )+\frac {B\,a\,e\,\sqrt {-a\,c^3}}{2}-\frac {C\,a\,d\,\sqrt {-a\,c^3}}{2}\right )\,\left (\frac {\left (x\,\left (6\,a\,c^2\,e^3-2\,c^3\,d^2\,e\right )+8\,a\,c^2\,d\,e^2\right )\,\left (c^2\,\left (\frac {A\,a\,e}{2}-\frac {B\,a\,d}{2}\right )-c\,\left (\frac {C\,a^2\,e}{2}-\frac {A\,d\,\sqrt {-a\,c^3}}{2}\right )+\frac {B\,a\,e\,\sqrt {-a\,c^3}}{2}-\frac {C\,a\,d\,\sqrt {-a\,c^3}}{2}\right )}{a^2\,c^2\,e^2+a\,c^3\,d^2}-x\,\left (2\,C\,c^2\,d^2-B\,c^2\,d\,e+3\,A\,c^2\,e^2-5\,C\,a\,c\,e^2\right )+B\,a\,c\,e^2-A\,c^2\,d\,e+5\,C\,a\,c\,d\,e\right )}{a^2\,c^2\,e^2+a\,c^3\,d^2}+A\,B\,c\,e-A\,C\,c\,d\right )\,\left (c^2\,\left (\frac {A\,a\,e}{2}-\frac {B\,a\,d}{2}\right )-c\,\left (\frac {C\,a^2\,e}{2}-\frac {A\,d\,\sqrt {-a\,c^3}}{2}\right )+\frac {B\,a\,e\,\sqrt {-a\,c^3}}{2}-\frac {C\,a\,d\,\sqrt {-a\,c^3}}{2}\right )}{a^2\,c^2\,e^2+a\,c^3\,d^2}-\frac {\ln \left (x\,\left (c\,e\,B^2-c\,d\,B\,C+a\,e\,C^2-A\,c\,e\,C\right )+C^2\,a\,d+\frac {\left (c^2\,\left (\frac {A\,a\,e}{2}-\frac {B\,a\,d}{2}\right )-c\,\left (\frac {C\,a^2\,e}{2}+\frac {A\,d\,\sqrt {-a\,c^3}}{2}\right )-\frac {B\,a\,e\,\sqrt {-a\,c^3}}{2}+\frac {C\,a\,d\,\sqrt {-a\,c^3}}{2}\right )\,\left (\frac {\left (x\,\left (6\,a\,c^2\,e^3-2\,c^3\,d^2\,e\right )+8\,a\,c^2\,d\,e^2\right )\,\left (c^2\,\left (\frac {A\,a\,e}{2}-\frac {B\,a\,d}{2}\right )-c\,\left (\frac {C\,a^2\,e}{2}+\frac {A\,d\,\sqrt {-a\,c^3}}{2}\right )-\frac {B\,a\,e\,\sqrt {-a\,c^3}}{2}+\frac {C\,a\,d\,\sqrt {-a\,c^3}}{2}\right )}{a^2\,c^2\,e^2+a\,c^3\,d^2}-x\,\left (2\,C\,c^2\,d^2-B\,c^2\,d\,e+3\,A\,c^2\,e^2-5\,C\,a\,c\,e^2\right )+B\,a\,c\,e^2-A\,c^2\,d\,e+5\,C\,a\,c\,d\,e\right )}{a^2\,c^2\,e^2+a\,c^3\,d^2}+A\,B\,c\,e-A\,C\,c\,d\right )\,\left (c^2\,\left (\frac {A\,a\,e}{2}-\frac {B\,a\,d}{2}\right )-c\,\left (\frac {C\,a^2\,e}{2}+\frac {A\,d\,\sqrt {-a\,c^3}}{2}\right )-\frac {B\,a\,e\,\sqrt {-a\,c^3}}{2}+\frac {C\,a\,d\,\sqrt {-a\,c^3}}{2}\right )}{a^2\,c^2\,e^2+a\,c^3\,d^2} \]

input
int((A + B*x + C*x^2)/((a + c*x^2)*(d + e*x)),x)
 
output
(log(d + e*x)*(A*e^2 + C*d^2 - B*d*e))/(a*e^3 + c*d^2*e) - (log(x*(C^2*a*e 
 + B^2*c*e - A*C*c*e - B*C*c*d) + C^2*a*d + ((c^2*((A*a*e)/2 - (B*a*d)/2) 
- c*((C*a^2*e)/2 - (A*d*(-a*c^3)^(1/2))/2) + (B*a*e*(-a*c^3)^(1/2))/2 - (C 
*a*d*(-a*c^3)^(1/2))/2)*(((x*(6*a*c^2*e^3 - 2*c^3*d^2*e) + 8*a*c^2*d*e^2)* 
(c^2*((A*a*e)/2 - (B*a*d)/2) - c*((C*a^2*e)/2 - (A*d*(-a*c^3)^(1/2))/2) + 
(B*a*e*(-a*c^3)^(1/2))/2 - (C*a*d*(-a*c^3)^(1/2))/2))/(a*c^3*d^2 + a^2*c^2 
*e^2) - x*(3*A*c^2*e^2 + 2*C*c^2*d^2 - 5*C*a*c*e^2 - B*c^2*d*e) + B*a*c*e^ 
2 - A*c^2*d*e + 5*C*a*c*d*e))/(a*c^3*d^2 + a^2*c^2*e^2) + A*B*c*e - A*C*c* 
d)*(c^2*((A*a*e)/2 - (B*a*d)/2) - c*((C*a^2*e)/2 - (A*d*(-a*c^3)^(1/2))/2) 
 + (B*a*e*(-a*c^3)^(1/2))/2 - (C*a*d*(-a*c^3)^(1/2))/2))/(a*c^3*d^2 + a^2* 
c^2*e^2) - (log(x*(C^2*a*e + B^2*c*e - A*C*c*e - B*C*c*d) + C^2*a*d + ((c^ 
2*((A*a*e)/2 - (B*a*d)/2) - c*((C*a^2*e)/2 + (A*d*(-a*c^3)^(1/2))/2) - (B* 
a*e*(-a*c^3)^(1/2))/2 + (C*a*d*(-a*c^3)^(1/2))/2)*(((x*(6*a*c^2*e^3 - 2*c^ 
3*d^2*e) + 8*a*c^2*d*e^2)*(c^2*((A*a*e)/2 - (B*a*d)/2) - c*((C*a^2*e)/2 + 
(A*d*(-a*c^3)^(1/2))/2) - (B*a*e*(-a*c^3)^(1/2))/2 + (C*a*d*(-a*c^3)^(1/2) 
)/2))/(a*c^3*d^2 + a^2*c^2*e^2) - x*(3*A*c^2*e^2 + 2*C*c^2*d^2 - 5*C*a*c*e 
^2 - B*c^2*d*e) + B*a*c*e^2 - A*c^2*d*e + 5*C*a*c*d*e))/(a*c^3*d^2 + a^2*c 
^2*e^2) + A*B*c*e - A*C*c*d)*(c^2*((A*a*e)/2 - (B*a*d)/2) - c*((C*a^2*e)/2 
 + (A*d*(-a*c^3)^(1/2))/2) - (B*a*e*(-a*c^3)^(1/2))/2 + (C*a*d*(-a*c^3)^(1 
/2))/2))/(a*c^3*d^2 + a^2*c^2*e^2)